package by.yakusekmaxim.bookgid.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.yakusekmaxim.bookgid.dataaccess.util.UserAccountFilter;
import by.yakusekmaxim.bookgid.datamodel.UserAccount;

public interface UserAccountService {

	UserAccount get(Long id);
	
	UserAccount getAccountByEmail(String email);

	@Transactional
	void saveOrUpdate(UserAccount userAccount);

	@Transactional
	void delete(UserAccount userAccount);

	@Transactional
	void deleteAll();

	@Transactional
	Long getCount();

	@Transactional
	Long getCount(SingularAttribute<UserAccount, ?> attribute, Object value);

	@Transactional
	List<UserAccount> getAllUserAccount(SingularAttribute<UserAccount, ?> attr,
			boolean ascending, int startRecord, int pageSize);

	@Transactional
	List<UserAccount> getAllUserAccount(SingularAttribute<UserAccount, ?> attr,
			boolean ascending, int startRecord, int pageSize,
			UserAccountFilter filter);

}
